/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.vfi.beans;

import edu.upn.sigemfi.vfi.bc.TransaccionDelegate;
import edu.upn.sigemfi.vfi.be.Transaccion;
import java.util.List;

/**
 *
 * @author Programador
 */
public class TransaccionController {
private TransaccionDelegate delegado;
    private Transaccion transaccion;

    public TransaccionController() {
        delegado = new TransaccionDelegate();
    }

    public List<Transaccion> getTransacciones() {
        try {
            return delegado.listar();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public String nuevo() {
        transaccion = new Transaccion();
        return "nuevo";
    }
    public String registrar() {
        try {
            delegado.crear(transaccion);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public Transaccion getTransaccion() {
        return transaccion;
    }
    public void setTransaccion(Transaccion transaccion) {
        this.transaccion = transaccion;
    }
}
